import { createRouter, createWebHashHistory } from 'vue-router';
import Demo1 from '../views/Demo1.vue';
import Demo2 from '../views/Demo2.vue';
import Demo3 from '../views/Demo3.vue';
import Demo4 from '../views/Demo4.vue';
import Demo5 from '../views/Demo5.vue';
import Demo6 from '../views/Demo6.vue';
import Demo7 from '../views/Demo7.vue';
import Home from '../views/Home.vue';

const routes = [
  {
    path: '/', // 首页路径
    redirect: '/home', // 默认重定向到 /home
  },
  {
    path: '/home',
    name: '首页',
    component: Home,
  },
  {
    path: '/demo1',
    name: '三栏布局',
    component: Demo1,
  },
  {
    path: '/demo2',
    name: '⽔平居中的导航菜单',
    component: Demo2,
  },
  {
    path: '/demo3',
    name: '修改背景',
    component: Demo3,
  },
  {
    path: '/demo4',
    name: '接口请求',
    component: Demo4,
  },
  {
    path: '/demo5',
    name: '去重函数',
    component: Demo5,
  },
  {
    path: '/demo6',
    name: '星期数字转换',
    component: Demo6,
  },
  {
    path: '/demo7',
    name: 'TODO应用',
    component: Demo7,
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;